Remove First and Last Element Array in JavaScript